The naval Battle of Ostia took place in 849 between some Saracen pirates and an Italian league of Papal, Neapolitan, Amalfitan and Gaetan ships. The battled ended in favor of the Italian league, as they successfully beat off the pirates. It is one of the few events to occur in southern Italy during the ninth century that is still remembered today, largely for the walls named after Leo and for the Renaissance painting Battaglia di Ostia by Raphael.
Starting in 827, Muslim forces had begun to conquer Sicily. In 846, Saracens sacked Rome, raiding various basilicas, including Saint Peter's, for their treasures.[1]
News of a massing of Saracen ships off Sardinia reached Rome early in 849. A Christian armada, commanded by Caesar, son of Sergius I of Naples, was assembled off recently refortified Ostia, and Pope Leo IV came out to bless it and communicate the troops (i.e., perform a Mass). After the pirate ships appeared, battle was joined with the Neapolitan galleys in the lead. Midway through the engagement, a storm divided the enemies and the Christian ships managed to return to port. The Muslims, however, were scattered far and wide, with many ships lost and others sent ashore. When the storm died down, the remnants of the Arab fleet were easily picked off, with many prisoners taken.
In the aftermath of the battle, much booty washed ashore and was pillaged by the locals, per ius naufragii. The prisoners taken in battle were sent to work in chain gangs building the Leonine Wall which was to encompass the Vatican Hill. Rome would never again be threatened by an Arab army.[1]